<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
$count=count($dataProvider->data);
?>
<?php echo Yii::t('main','my-selection');?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="texteSimple">
 <tr>
          <td align="center"><hr noshade width="100%" color="#CCCCCC" size="1" ></td>
        </tr>
<tr><td><a href="<?php if(isset($_SERVER['HTTP_REFERER']))echo $_SERVER['HTTP_REFERER'];?>" class="texteSimple"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icon-backpage.png" width="22" height="19" border="0" align="bottom">&nbsp;&nbsp;&nbsp;<?php echo Yii::t('main','my-selection-return');?></a></td></tr>
<tr><td>
<?php 
$this->widget('zii.widgets.grid.CGridView', array(
		'id'=>'tableFicheMini',
		'dataProvider'=>$dataProvider,		
		'htmlOptions'=>array('style'=>'width:100%;cursor: pointer;'),
		'selectionChanged'=>"function(id){window.location='" . Yii::app()->urlManager->createUrl('location/view', array('id'=>'')) . "/' + $.fn.yiiGridView.getSelection(id);}",
		'itemsCssClass' => 'premiumGrid',		
		'columns'=>array(
				'id',
				'name',
				//'idDepartment.code',
				array(
						'name'=>Yii::t("location", "label-dept"),
						'value'=>'$data->idDepartment->code',
				),
				array(
					'name'=>Yii::t("location", "label-type"),
					'value'=>'$data->idType->name',
				),
// 				'idType.name',
				array(
						'name'=>'image',
						'type'=>'html',
						'value'=>'CHtml::image($data->mainImage->getImagePath("114x72"),"",array("style"=>"width:100px;"))',
				),
				array(
						'header'=>'Action',
						'class'=>'CButtonColumn',
						'template'=>'{delete}',					
						'deleteButtonImageUrl' => Yii::app()->baseUrl . '/images/icon_delete.png',
				),
		),
));
?>
</td></tr></table>
<p align="right">
<?php if($count>0) echo CHtml::link(Yii::t('main','delete-all'),array('site/deleteAll'));?>
</p>
<?php 	
	$this->renderPartial('_contactloc',array('model'=>$model,'count'=>$count,));
?>
